[Newbie] Script output

Can anyone help me out to get the output on two rows in excel.

for /f "skip=3" %i in ('qfarm /load') do quser /server:%i | find /i /c "Active" && echo %i >> "c:\Temp\server.csv"

I can get them on row A and B. Is there also away to get the total amount.

January 30th, 2014 1:59pm

What type of output does qfarm generate?
When you say "two rows", do you perhaps mean "two columns"? Posting the desired output would help.
Free Windows Admin Tool Kit Click here and download it now
January 31st, 2014 10:06pm

As the other responders suggested, your request is a bit vague.  I'm guessing you want the two pieces of data on a single line in the output CSV file.  If that is the case, using a second FOR statement to read the results of the "quser" statement should work (but I can't do a literal test to be certain).  Maybe something like this (as a batch file, rather than at the command prompt) ...

 @echo off
  for /f "skip=3" %%i in ('qfarm /load') do (
    for /f "delims=" %%A in ('quser /server:%%i ^| find /i /c "Active"') do (
      echo %%A %%i)>> "c:\Temp\server.csv"
  )
February 1st, 2014 11:16am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics